<?php

namespace extend;

class SmsExt
{
    public static function send($mobile, $text): bool
    {
        $u = env("sms_bao.user");
        $key = env("sms_bao.key");
        $api = "https://api.smsbao.com/sms?u={$u}&p={$key}&m={$mobile}&c={$text}";
        try {
            $result =  file_get_contents($api);
            return true;
        } catch (\Throwable $th) {
            return false;
        }
    }
}